package 设计原则.单一职责原则;

public class SingleResponsibility3 {
    public static void main(String[] args) {
        VehicleNew vehicle = new VehicleNew();
        vehicle.run("摩托车");
        vehicle.runSky("飞机");
        vehicle.runSea("潜艇");
    }
}
//方法级别
class VehicleNew {
    public void run(String tool) {
        System.out.println(tool+"在公路上跑.");
    }

    public void runSky(String tool) {
        System.out.println(tool+"在天上运行.");
    }

    public void runSea(String tool) {
        System.out.println(tool+"在海里运行.");
    }
}